<?php
defined('IN_MAIN') or exit('Invalid Access!');

function ajax_check_user($uid){
/*
check if the input uid exist in the db
	1 - member found
	2 - member terminated
	3 - member not found
*/
	global $vars;
	$db = $vars['db'];
	
	$status = $user_detail = '';
	if(!$user=get_user_detail_by_id($uid)){
		$status = 3;
	}elseif($user['status']=='terminated'){
		$status = 2;
	}else{
		$status = 1;
		$user_detail = $user;
	}
	
	$result['status'] = $status;
	$result['user_detail'] = $user_detail;
	
	return $result;
}
?>